# from crypt import methods
# from crypt import methods
from flask import Flask, jsonify, request, render_template


app = Flask(__name__)

students = [ ]

@app.route('/') # 获取学生信息页面
def index():
    return render_template('index.html')

@app.route('/share',methods=['get']) 
def share():
    return render_template('share.html')

@app.route('/addstu',methods=['post'])
def addstu():
    data = request.data.decode('utf-8')
    students.append(eval(data))
    print(students)
    return students

@app.route('/getstu',methods=['get']) 
def getstu():
    return students

if __name__ == '__main__':
    app.run(debug=True,host='0.0.0.0',port=80)
